﻿using System;
using YWM.Common.Exceptions;
using YWM.Localization;

namespace YWM.Exceptions
{
    public static class Oops
    {
        public static FriendlyException Oh(string message)
        {
            return Oh(message, null);
        }

        public static FriendlyException Oh(string message, Exception originException)
        {
            ILocalizationManager lang = YApp.Resolve<ILocalizationManager>();
            FriendlyException friendlyException = new FriendlyException(lang[message], originException);
            return friendlyException;
        }
    }
}
